<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <title></title>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
           $(".alink").click(function(){
               var url="http://www.baidu.com/";
               var $a=$("<a>",{href:url});
               alert($a.attr("href"));
               $("#main").load(url);
               return false;
           });

         }
        );
    </script>
</head>
<body>
<h3><a href="http://www.baidu.com/" target="myframe">点击我,内容会显示在iframe中哦</a></h3>

<h3><div class="alink" style="cursor: pointer;">
    点击我,内容会显示在div中哦
</div></h3>

<div id="main" style="width: 800px;height: 600px;border: 1px;border-style:solid;float: left;">
</div>
<div style="float: left;">
<iframe name="myframe" frameborder="1px" width="800px" height="600px">

</iframe>
</div>
</body>
</html>